var dialogJs = 'dialog-plus';

seajs.use(dialogJs, function (dialog) {
	$dialog = dialog;
});

var $info_ok = function(content,time){
	seajs.use(dialogJs, function (dialog) {
		var d = dialog({
			fixed: true,
		  	content: '<div class="yes"><span>'+content+'</span></div>'
		}).showModal();
		setTimeout(function () {
		    d.close().remove();
		}, time?time:2000);
	});
}
var $info_no = function(content,time){
	seajs.use(dialogJs, function (dialog) {
		var d = dialog({
			fixed: true,
		  	content: '<div class="no"><span>'+content+'</span></div>'
		}).showModal();
		setTimeout(function () {
		    d.close().remove();
		}, time?time:2000);
	});
}
var $alert = function(content){
	seajs.use(dialogJs, function (dialog) {
		dialog({
			fixed: true,
			content: content,
			okValue: '确定',
		    ok: function () {return true}
		}).showModal();
	});
}
var $confirm = function(content,obj,fun){
	seajs.use(dialogJs, function (dialog) {
		d = dialog({
			quickClose: true,
			content: content,
			okValue: '确定',
		    ok: function () {
				this.close(true);
        		this.remove();
			},
		    cancelValue: '取消',
	    	cancel: function () {
		    	this.close(false);
        		this.remove();
        	}
		}).showModal(obj).addEventListener('close',function(){
			fun(this.returnValue);
		});
	});
}